<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="canonical" href="https://jamesfengcao.gitlab.io/uweb/en/ebrowserreadme/" />
    
    <link rel="stylesheet" href="../style.css#" type="text/css" />
    <title></title>
    <script>
      function findLang(){
        let href = location.href;
        for(let i=href.length-1;i>0;i--){
          if('/'==href.charAt(i) && '/'==href.charAt(i-3))
            return i;
        }
        return 0;
      }
      function nav2(page){
        let i = findLang();
        location.href = location.href.substring(0,i+1)+page;
      }
      function nav2Lang(lang){
        let i = findLang();
        let href = location.href;
        location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
      }
    </script>
  </head>
  <body>
    <header class='header'>
      <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
      
      <nav>
      </nav>
    </header>
    <br />
    
<div class="container">
  <h1 class="title">
    <br>
    <span class="subtitle"></span>
  </h1>
  <ul class="tags">
    
  </ul>
  <script>function notRepo(){let u=location.href.replace(/#$/, '');return u.endsWith('index.html')||u.endsWith('readme/');}</script>
<!--%3cmeta http-equiv=refresh content=%220;url=%68ttps://gitee.com/jamesfengcao/uweb/raw/master/redirect.html#%22%3e-->
<h1 id="ebrowser-keyboard-friendly-minimal-suckless-web-browser"><a href="https://github.com/torappinfo/ebrowser">Ebrowser</a>: keyboard-friendly minimal suckless web browser</h1>
<p>Ebrowser is designed with the philosophy of <a href="https://github.com/torappinfo/uweb">Android uweb browser</a> (<a href="https://gitlab.com/jamesfengcao/uweb">gitlab</a>).</p>
<ul>
<li>lightweight (less than 20k bytes) without bundled electron.</li>
<li>much less memory footprint than edge/chrome browser and highly performant.</li>
<li>keyboard friendly with vim-style keymaps and command line support in address bar.</li>
<li><a href="https://uweb.surge.sh/en/redirect/index.html#" onclick="if(notRepo()){location='../redirect/index.html#';return false;}">global redirection</a> to bypass censorship.</li>
<li>user CSS/JS at will. Ex. pressing &quot;md&quot; in no-focus mode to preview markdown file.</li>
<li>global CSS/JS for all sites at will.</li>
<li>CSS/JS for domains, similar to <a href="https://jamesfengcao.gitlab.io/uweb/en/sitejs/index.html">uweb</a>, but use sitejs/[domain].js or sitecss/[domain].css, not [domain root].js/css.</li>
<li>customizable.</li>
<li>dark theme support.</li>
</ul>
<p>Note: Usually electron apps are heavyweight as they use browsers for simple things. Ebrowser uses core chromium effectively and very lightweight.</p>
<h2 id="installing-for-windows-macos-and-linux">Installing (for Windows, MacOS and Linux)</h2>
<h3 id="install-with-prebuilt-binaries">Install with prebuilt binaries</h3>
<p>You can find prebuilt binaries <a href="https://github.com/torappinfo/ebrowser/releases">here</a>.</p>
<h3 id="install-ebrowser-and-electron-separatedly-recommended">Install ebrowser and electron separatedly (Recommended)</h3>
<h4 id="install-ebrowser">Install ebrowser</h4>
<p>Either download (Click the green &quot;Code&quot; button above the file list =&gt; Select &quot;Download ZIP&quot;) and unzip from</p>
<pre><code>https://github.com/torappinfo/ebrowser
</code></pre>
<p>OR download and unzip ebrowser package directly from any of npm mirror sites like <a href="https://npmmirror.com/package/ebrowser">npmmirror</a> or with nodejs by</p>
<pre><code>npm install ebrowser
</code></pre>
<p>OR download/&quot;git clone&quot; files directly from any of <a href="https://gitlab.com/jamesfengcao/uweb/-/blob/master/en/mirrors.md">mirror repositories</a> and ebrowser is under the folder &quot;misc/ebrowser&quot;.</p>
<h4 id="install-electron">Install electron</h4>
<p>Before you can run ebrowser, you need to install electron either with nodejs by</p>
<pre><code>npm install electron
</code></pre>
<p>OR download and unzip electron binary directly from <a href="https://github.com/electron/electron/releases">github</a> or mirrors like <a href="https://registry.npmmirror.com/binary.html?path=electron">npmmirror</a>.</p>
<h4 id="run-ebrowser">Run ebrowser</h4>
<pre><code>electron ~/node_modules/ebrowser
</code></pre>
<p>OR</p>
<pre><code>electron [the-path-of-folder-with-downloaded-ebrowser-files]
</code></pre>
<h3 id="update-app-quickly-without-updating-chromium">Update app quickly without updating chromium</h3>
<p>Pressing &quot;Alt&quot; to show the menu bar and choose &quot;Check for updates&quot; under &quot;Help&quot;. OR</p>
<p>Type &quot;:update&quot; in the address bar and press &quot;enter&quot; key to update.</p>
<h2 id="key-shortcuts">Key shortcuts</h2>
<ul>
<li>Alt: show menu</li>
<li>ALT+&lt;-: go backward</li>
<li>ALT+-&gt;: go forward</li>
<li>CTRL+C: stop loading</li>
<li>CTRL+G: address bar to show page url</li>
<li>CTRL+L: focus to address bar</li>
<li>CTRL+T: new Tab</li>
<li>CTRL+SHIFT+T: restore closed Tab</li>
<li>CTRL+TAB: switch to next tab</li>
<li>CTRL+SHIFT+TAB: switch to previous tab</li>
<li>CTRL+W: close Tab</li>
<li>CTRL+SHIFT+R: enable global redirection (&quot;gredirect.json&quot;)</li>
<li>CTRL+R: disable global redirection</li>
<li>ESC: remove focus. similar to vi normal mode.</li>
<li>F1: Help</li>
<li>F5: page refresh/reload</li>
<li>F12: devtools</li>
</ul>
<h2 id="address-bar-commands">Address bar commands</h2>
<p>Like any popular browser, the very first word in address bar if defined in &quot;search.json&quot; identifies a <a href="https://jamesfengcao.gitlab.io/uweb/en/search/index.html" onclick="if(notRepo()){location='../search/index.html#';return false;}">search engine</a>. Moreover, the address bar serves as command line interface:</p>
<ul>
<li>&quot;/&quot; for find-in-page</li>
<li>&quot;:&quot; for address bar commands
<ul>
<li>ac [bookmark/history path w/o ext] : load &quot;.rec&quot; file for autocomplete.</li>
<li>b [bookmarkfilename w/o ext] : bookmark current page in file.</li>
<li>bjs : Browser-level JavaScript execution.</li>
<li>bml [filename w/o extension] [arguments...]: load/execute the javascript file.</li>
<li>cert : allow invalid certificates w/o arguments, otherwise restore to default.</li>
<li>clear : the arguments could be
<ul>
<li>cache : clear cache</li>
<li>dns : clear dns cache</li>
<li>storage: clear site storage data.</li>
<li>{<a href="https://www.electronjs.org/docs/latest/api/session#sescleardataoptions">options</a>}</li>
</ul>
</li>
<li>exit : exit browser</li>
<li>ext [extension path]: load unpacked Chrome extension.</li>
<li>gr [gredirect index]: global redirection with corresponding index. Use the first global redirection url if no argument. Disable global redirection with any index out of the range.</li>
<li>js [js code] : execute JS code at OS level. Note: &quot;javascript:...&quot; is special url and thus works in the current web page, while &quot;:js ...&quot; commands can do any OS operations.</li>
<li>nc/uc : No Cookie forwarding/Use Cookie forwarding with global redirection.</li>
<li>nr/ur for No/Use &quot;redirect.json&quot; for domain redirection.</li>
<li>np : no proxy.</li>
<li>up [proxyName] : use proxy. privous proxy or the first proxy in proxy.json w/o [proxyName]. &quot;:up&quot; command also disables global and domain redirections, which are not restored by &quot;:np&quot;.</li>
<li>sys [command line] : execute system commands with url as one of arguments, and replace &quot;%cookie&quot; with corresponding one. Ex. &quot;curl&quot; commands for uploading.</li>
<li>ua [useragentName] : set user agent for future tabs. default user agent w/o arguments.</li>
<li>update [filename] : update the app w/o argument, otherwise retrive the [filename] from remote. The filename could be any file on <a href="https://jamesfengcao.gitlab.io/uweb/en/readme/index.html">mirror sites</a> (this repository is part of it).</li>
<li>pdf [filename w/o extension] {<a href="https://www.electronjs.org/docs/latest/api/web-contents#contentsprinttopdfoptions">options</a>} : print to PDF file. All arguments are optional; empty option &quot;{}&quot; to capture long screenshot as vector graphics.</li>
</ul>
</li>
<li>&quot;!&quot; address bar commands
<ul>
<li>&quot;!xx ...&quot; evaluates &quot;xx.js&quot; with the whole text as arguments[0] at OS level.</li>
<li>&quot;!!xx ...&quot; evaluates &quot;xx.js&quot; with the whole text as arguments[0] at browser level, which could manipulate address bar etc.</li>
</ul>
</li>
<li>i: internal urls, which will be consistent with <a href="https://jamesfengcao.gitlab.io/uweb/en/links/index.html">uweb</a>.
<ul>
<li>&quot;i:0/js/xxx.js:[url]&quot; loads the &quot;[url]&quot; with bookmarklet &quot;js/xxx.js&quot;.</li>
<li>&quot;i:8d[url]&quot; fo force downloading</li>
</ul>
</li>
</ul>
<h2 id="commands-in-no-focus-mode-this-mode-is-similar-to-vi-normal-mode">Commands in no-focus mode (this mode is similar to vi Normal mode)</h2>
<p>Pressing &quot;ESC&quot; to enter no-focus mode if not sure.</p>
<ul>
<li>&quot;:&quot; for address bar commands</li>
<li>&quot;/&quot; for find-in-page with address bar</li>
<li>&quot;!&quot; for &quot;!&quot; address bar commands</li>
</ul>
<p>The other commands are defined in &quot;mapkeys.json&quot;, which will map keys to address bar commands.</p>
<h2 id="configuration-files">Configuration files</h2>
<ul>
<li>&quot;config&quot;: lines of address bar commands.</li>
<li>&quot;search.json&quot;: <a href="https://jamesfengcao.gitlab.io/uweb/en/search/index.html" onclick="if(notRepo()){location='../search/index.html#';return false;}">search engines</a> as shortcut-queryUrl pairs, where &quot;%s&quot; would be replaced by search query.</li>
<li>&quot;default.autoc&quot;: predefined strings for address bar auto completion.</li>
<li>&quot;gredirect.json&quot;: global redirection urls as array of urls</li>
<li>&quot;redirect.json&quot;: domain-replacementDomain pairs, default to be applied.</li>
<li>&quot;mapkeys.json&quot;: keys-addressbarCommands pairs. The addressbar commands are multiple lines of address bar command separated by &quot;\n&quot;.</li>
<li>&quot;proxy.json&quot;: name-<a href="https://www.electronjs.org/docs/latest/api/structures/proxy-config">ProxyConfig</a> pairs</li>
<li>&quot;uas.json&quot; : name-<a href="https://jamesfengcao.gitlab.io/uweb/en/useragents/index.html" onclick="if(notRepo()){location='../useragents/index.html#';return false;}">useragent</a> pairs.</li>
<li>Customized menus: json files as array of strings with menuitem name and address bar commands alternately.
<ul>
<li>&quot;menu.json&quot;: array of strings for <a href="https://jamesfengcao.gitlab.io/uweb/en/urls/index.html" onclick="if(notRepo()){location='../urls/index.html#';return false;}">user-defined menus</a>. The array has submenu name and address bar commands alternately. The odd-indexed strings are address bar commands with &quot;%u&quot; as the downloaded url.</li>
<li>&quot;select.json&quot;: to define menus for text selections. The odd-indexed strings are address bar commands with &quot;%s&quot; as the text selection.</li>
<li>&quot;download.json&quot; : array of strings to define context menu and buttons for downloading dialog. The even-indexed strings are texts to show on the button. The odd-indexed strings are address bar commands with &quot;%u&quot; as the downloaded url.</li>
</ul>
</li>
</ul>
<h2 id="javascript-at-three-levels">Javascript at three levels</h2>
<ul>
<li>Web page: url like &quot;javascript:&quot; or bookmarklet command &quot;:bml&quot; runs in web page.</li>
<li>Browser (or renderer process) :
<ul>
<li>&quot;:bjs&quot; to execute the following js code at browser level.</li>
</ul>
</li>
<li>OS level (or main process) : &quot;:js&quot; to execute the following js code with all OS APIs available.
<ul>
<li>&quot;!xx&quot; evaluates &quot;xx.js&quot; with arguments.</li>
</ul>
</li>
</ul>
<h3 id="examples-for-jsbjs-commands">examples for &quot;:js&quot;/&quot;:bjs&quot; commands</h3>
<pre><code>:js bJS=true //allow external Javascript files for web pages
:js bJS=false //disallow external Javascript files for web pages
:bjs bHistory=true //to record url history
:bjs bQueryHistory=true //to record query/command history
</code></pre>
<h2 id="new-usages">New usages</h2>
<ul>
<li>
<p>Vector designing with web tech to replace Adobe Illustrator/Inkscape.</p>
<ul>
<li>
<p>Design with web tech.</p>
</li>
<li>
<p>Printing to pdf with customized paper size.</p>
</li>
<li>
<p>Magnify the pdf paper size to the required size.</p>
</li>
</ul>
<p>OR</p>
<ul>
<li>Adjust window width and use addressbar command line &quot;:Pdf {}&quot; to export vector graphics.</li>
<li>Use imageMagick to convert to any other vector graphics format.</li>
</ul>
</li>
</ul>
<h2 id="license">License</h2>
<p>You can copy or modify the code/program under the terms of the GPL3.0 or later versions.</p>

</div>
<p>Last Modified: 12 November 2025<br>
optimize ebrowser README<br>
<pre></pre>
</p>

<script id='jsgiscus'
  src='https://giscus.app/client.js'
  data-repo="torappinfo/uweb"
  data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  data-category="Announcements"
  data-category-id="DIC_kwDOEgNLGc4CQjsh"
  data-mapping="title"
  data-strict="0"
  data-reactions-enabled="1"
  data-emit-metadata="0"
  data-input-position="top"
  data-theme="light"
  data-lang="en"
  data-loading="lazy"
  crossorigin="anonymous" async>
</script>

    <footer class="site-footer">
      <div class="container">
        &copy; 2018-2025 Richard H. Cao
      </div>
    </footer>
    <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->


  </body>
</html>
